/*!
\copyright  Copyright (c) 2023-2025 Qualcomm Technologies International, Ltd.
            All Rights Reserved.
            Qualcomm Technologies International, Ltd. Confidential and Proprietary.
\file
\brief      LE Audio graph related type definitions.
 
*/

#ifndef AUDIO_LEA_TYPES_H_
#define AUDIO_LEA_TYPES_H_

#include "csrtypes.h"

/*! Maximum number of ISO streams that can be supported */
#define KYMERA_MAX_ISO_HANDLES_TO_RENDER            2
#define AUDIO_LOCATION_UNKNOWN                      ((0xFFFFFFFF))

/*@{*/

/*! \brief Defines the different codecs used for le audio */
typedef enum
{
    KYMERA_LE_AUDIO_CODEC_LC3,
    KYMERA_LE_AUDIO_CODEC_APTX_ADAPTIVE,                                /* AptX Adaptive R3 */
    KYMERA_LE_AUDIO_CODEC_APTX_LITE,
    KYMERA_LE_AUDIO_CODEC_APTX_ADAPTIVE_R4,                             /* AptX Adaptive R4 */
} appKymeraLeAudioCodec;

/*! \brief Defines the type of LE audio decoder chain configuration */
typedef enum
{
    KYMERA_LE_AUDIO_DECODER_CONFIG_TYPE_SINGLE_DECODER_TO_MONO,         /* Single mono decoder to mono output chain configuration */
    KYMERA_LE_AUDIO_DECODER_CONFIG_TYPE_SINGLE_DECODER_TO_DUAL_MONO,    /* Single mono decoder split into two mono output chain configuration */
    KYMERA_LE_AUDIO_DECODER_CONFIG_TYPE_SINGLE_DECODER_TO_STEREO,       /* Single decoder (joint) to stereo output chain configuration. */
    KYMERA_LE_AUDIO_DECODER_CONFIG_TYPE_DUAL_DECODER_TO_STEREO,         /* Dual decoder to stereo output chain configuration. */
    KYMERA_LE_AUDIO_DECODER_CONFIG_TYPE_DUAL_DECODER_TO_MONO,           /* Dual decoder to mono output chain configuration. */
    KYMERA_LE_AUDIO_DECODER_CONFIG_TYPE_MAX
} appKymeraLeAudioDecoderConfigType;

/*! \brief Defines the type of LE audio encoder chain configuration */
typedef enum
{
    KYMERA_LE_AUDIO_ENCODER_CONFIG_TYPE_STEREO_TO_SINGLE_MONO_CIS,      /* Stereo input to single mono CIS encoder chain configuration */
    KYMERA_LE_AUDIO_ENCODER_CONFIG_TYPE_STEREO_TO_DUAL_MONO_CIS,        /* Stereo input to dual mono CIS encoder chain configuration */
    KYMERA_LE_AUDIO_ENCODER_CONFIG_TYPE_STEREO_TO_SINGLE_STEREO_CIS,    /* Stereo input to single stereo CIS encoder chain configuration */
    KYMERA_LE_AUDIO_ENCODER_CONFIG_TYPE_MAX
} appKymeraLeAudioEncoderConfigType;

typedef enum
{
    KYMERA_LE_STREAM_MONO,                  /* Single BIS/CIS carrying mono, left only or right only data */
    KYMERA_LE_STREAM_STEREO_USE_LEFT,       /* Single BIS/CIS carrying stereo but use only LEFT */
    KYMERA_LE_STREAM_STEREO_USE_RIGHT,      /* Single BIS/CIS carrying stereo but use only RIGHT */
    KYMERA_LE_STREAM_STEREO_USE_BOTH,       /* Single BIS/CIS carrying stereo and use both */
    KYMERA_LE_STREAM_DUAL_MONO,             /* DUAL CIS carrying stereo and use both channel */
    KYMERA_LE_STREAM_DUAL_MONO_USE_LEFT,    /* DUAL CIS carrying stereo but use only left channel */
    KYMERA_LE_STREAM_DUAL_MONO_USE_RIGHT,   /* DUAL CIS carrying stereo but use only right channel */
    KYMERA_LE_STREAM_MAX
} appKymeraLeStreamType;

/*! \brief Defines the type of LE audio ISO Channel */
typedef enum
{
    KYMERA_LE_AUDIO_ISO_CHANNEL_LEFT        = (1 << 0),
    KYMERA_LE_AUDIO_ISO_CHANNEL_RIGHT       = (1 << 1)
} appKymeraLeAudioChannelType;

/*! \brief ISO handle information for direction, associated audio channels */
typedef struct
{
    /*! ISO stream Handle */
    uint16 handle;

    /*! Associated audio channels with the ISO stream, see \ref AudioLocationType */
    uint32 channels;
} kymera_le_audio_iso_handle_t;

/*! \brief ISO information, number of handles, audio channels to render */
typedef struct
{
    /*! Number of valid ISO channels (Cannot exceed \ref KYMERA_MAX_ISO_HANDLES_TO_RENDER) */
    uint16  handle_count;

    /*! ISO handles information */
    kymera_le_audio_iso_handle_t handles[KYMERA_MAX_ISO_HANDLES_TO_RENDER];
} kymera_le_audio_iso_handle_list_t;

/*! @brief This structure uniquely identifies a codec. The codec can either be defined in the Bluetooth
    *         specifications or vendor specific.
    */
typedef struct
{
    /*! The coding format value as defined in the Bluetooth Assigned Numbers.
        *
        *  A value of 0xFF specifies a Vendor Specific coding format.*/
    uint8 codingFormat;
    /*! For Vendor Specific coding formats this field specifies the Company ID as defined in Bluetooth Assigned Numbers.
        *
        *  For coding formats listed in the Bluetooth Assigned Numbers this field shall be 0x0000. */
    uint16 companyId;
    /*! For Vendor Specific coding formats this field specifies the Vendor specific Codec Id.
        *
        *  For coding formats listed in the Bluetooth Assigned Numbers this field shall be 0x0000. */
    uint16 vendorSpecificCodecId;
} appKymeraLeCodecId;

/*@}*/

#endif /*AUDIO_LEA_TYPES_H_ */
